<?$this->extend("layout/default")?>

<div id="tabs">
	<ul>
		<li><a href="#main"> Tableau de bord </a></li>
		<li><a href="#factures"> Factures </a></li>
		<li><a href="#paiements"> Paiements </a></li>
	</ul>
	<div id="main">
		<div class="configbox corner">
		<?=$this->inc("achats/dashboard",array("achats"=>$achats));?>
		</div>
	</div>
	<div id="factures">
		<div class="configbox corner">
			<?=$this->inc("achats/facture",array("factures"=>$factures,"aContacts"=>$aContacts,"aPaiementsFournisseur"=>$aPaiementsFournisseur,
						"typesReglements"=>$typesReglements,"aTVA"=>$aTVA,"planComptable"=>$planComptable));?>
		</div>
	</div>
	<div id="paiements">
		<div class="configbox corner">
			<?=$this->inc("achats/paiements",array("factures"=>$factures,"aContacts"=>$aContacts,"aPaiementsFournisseur"=>$aPaiementsFournisseur));?>
		</div>
	</div>
</div>
<script>
<?php 
	
	if(isset($_GET["factures"])) $idSelected = "1";
	elseif(isset($_GET["paiements"])) $idSelected = "2";
	else $idSelected = "0";
?>
$(document).ready(function() {
	$( "#tabs" ).tabs("select", <?=$idSelected?> );
});
</script>
<div id="newFactureOK_dial">

</div>
<div id="preview"></div>